<template name="defaultLayout">
    <div id="wrap">
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/">{{siteName}}</a>
                </div>

                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        {{{navmenu}}}
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        {{#if currentUser}}
                            <li>
                                <a href="/user/signout">Sign Out</a>
                            </li>
                        {{else}}
                            <li>
                                <a href="/user/signin">Sign In</a>
                            </li>
                            <li>
                                <a href="/user/signup">Sign Up</a>
                            </li>
                        {{/if}}
                        <!-- here -->
                    </ul>
                </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
        </nav>

        {{> yield}} 
    </div>

    <footer>&copy;2015 Meteor CMS by <a href="http://www.kimoworks.com" target="_blank">KimoWorks</a>
    </footer>
</template>

<template name="pages">
    <div class="container">
        {{{content}}}
    </div>
</template>

<template name="loading">
    <div class="container">
        LD?!
    </div>
</template>

<template name="notFound">
    <div class="container">
        NF?!
    </div>
</template>

<template name="signup">
    <div class="container">
        {{> flashMessages}}
        <form class="form-signup" action="/api/user/signup" method="post" role="form">
            <h2 class="form-signup-heading">注册账号</h2>
            <input class="form-control" id="signup-email" type="email" name="email" placeholder="填写邮箱" required autofocus />
            <input class="form-control" id="signup-username" type="text" name="username" placeholder="填写用户名" required />
            <input class="form-control" id="signup-password-1" type="password" name="password" placeholder="填写密码" required />
            <input class="form-control" id="signup-password-2" type="password" name="password2" placeholder="再次填写密码" required />
            <br />
            <button class="btn btn-lg btn-primary btn-block" type="submit">
            注册
            </button>
        </form>
    </div>
</template>

<template name="signin">
    <div class="container">
        {{> flashMessages}}
        <form class="form-signin" action="/api/user/signin" method="post" role="form">
            <h2 class="form-signin-heading">登录账号</h2>
            <input class="form-control" id="signin-email" type="email" name="email" placeholder="填写邮箱" required autofocus />
            <input class="form-control" id="signin-password" type="password" name="password" placeholder="填写密码" required />
            <br />
            <button class="btn btn-lg btn-primary btn-block" type="submit">
            登录
            </button>
        </form>
    </div>
</template>